<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/header.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>原型系统</title>
<script type="text/javascript">
if (window != top){
	top.location.href = location.href; 
}
$(function(){
	 $(window).keydown(function(e){
		   if(e.keyCode==13)
		     login();
	  });
	  if('${error}'){
		   myAlert("提示","${error}","e");
	  }
	  $("#userAccount").focus();
	 reft();
});

function login(){
	 //md5加密传输  
    var salt="{*nbsjt*asar#cdxd#}";  
    var pwd=$('#password').val();  
    var reg=/^(?!(?:[^a-z]+|\D+|[^A-Z]+|\D+|[^0-9]+|\D+|[a-zA-Z0-9]+)$).{8,20}$/;
    if(pwd){
     //var md5Pwd=b64_md5(pwd+salt);
     $('#password').val('************');
     $('#userPassword').val(pwd);
    $("form").submit();
    }
}
var index=1;
function refreshImg(){
	if(index>20){
		myAlert("提示","操作太频繁，请稍后再试...","w");
        return;
		}
	 $("#img").attr("src","${base}images/spinner.gif");
	 setTimeout("reft()",500);
}
function reft(){
	$("#img").attr("src","${base}/jcaptcha.jpg?"+(index++));
}
 
</script>
</head>
<body style="width:100%;height:100%;">
<div style="margin:150px 450px;">
<form action="" method="post"> 
     <div class="easyui-panel" title="登录系统" style="width:400px;padding:30px 70px 20px 70px;">
		<div style="margin-bottom:10px">
			<input class="easyui-textbox" style="width:100%;height:40px;padding:12px"id="userAccount" name="username" data-options="prompt:'用户名',iconCls:'icon-man',iconWidth:38"/>
		</div>
		<div style="margin-bottom:10px">
			<input class="easyui-textbox"  type="password"  id="password" style="width:100%;height:40px;padding:12px" data-options="prompt:'密码    ' ,iconCls:'icon-lock',iconWidth:38"/>
		    <input type="hidden" name="password" id="userPassword"/>
		</div>
		<div style="margin-bottom:10px">
		    <div style="float:left;"><img  src="${base}images/spinner.gif" title="点击刷新" onclick="refreshImg()" id="img" style="cursor: pointer;" height="30"/> </div>
			<div style="float:right;"><input class="easyui-textbox" name="jcaptchaCode" type="easyui-textbox" style="width:130px;height:30px;padding:12px" data-options="prompt:'验证码'"/></div>
		    <div style="clear:both;"></div>
		</div>
		<div style="margin-bottom:20px">
			<input type="checkbox"  name="rememberMe"  id="checkedUser"/>
			<label for="checkedUser">自动登录（一个月）</label>
		</div>
		<div>
			<a href="javascript:login();" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="padding:5px 0px;width:100%;">
				<span style="font-size:14px;">登录</span>
			</a>
		</div>
	</div>
</form>
</div>
</body>
</html>